<?php
require(dirname(__FILE__) . '/includes/init.php');
$group_list = $db->getAll("select * from ".$ecs->table('jd_group')." order by group_id desc");
foreach($group_list as $index=>$group){
	if($group['end_time']==0){
		$group_list[$index]['end_time']='未结束';
	}
	$group_list[$index]['start_time']= date('Y-m-d H:i:s',$group['start_time']);
	$group_list[$index]['products_name']= sub_str($group['products_name'],25);
	
}
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>管理中心 - 京东团购列表 </title>
<meta name="robots" content="noindex, nofollow">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<link href="styles/general.css" rel="stylesheet" type="text/css" />
<link href="styles/main.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="js/jquery.min.js"></script>
<script type="text/javascript" src="js/common.js"></script>
</head>
<body>
<h1>
<span class="action-span1"><a href="index.php?act=main">管理中心</a> </span><span id="search_id" class="action-span1"> -  京东团购列表 </span>
<div style="clear:both"></div>
</h1> 
<div class="list-div" id="listDiv"> 
<table cellpadding="3" cellspacing="1">
  <tr>
    <th>商家</th>
    <th>产品名</th>
    <th>起始日期</th>
    <th>结束日期</th>
    <th>操作</th>
  </tr>
  <?php 
	if(count($group_list)>0){
		foreach($group_list as $val){
  ?>
  <tr>
  	<td><?php echo $val['provider'];?></td>
	<td><a href="<?php echo $val['link'];?>" target="_blank"><?php echo $val['products_name'];?></a></td>
	<td><?php echo $val['start_time'];?></td>
	<td><?php echo $val['end_time'];?></td>
	<td><a href="jd_group_detail.php?groupid=<?php echo $val['group_id'];?>">查看</a></td>
  </tr>
  <?php
  		}
	}
  ?>
  </table>
  </div>
</body>
</html>